package com.ruoyi.merchant.msg.Model;


import com.ruoyi.merchant.msg.requ.AbstractRequMsg;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
 * 8心率数据上传（上行协议号：AP49，响应：BP49）
 */
@Slf4j
@Data
public class AP49 extends AbstractRequMsg {
    /**
     * 数据起封包
     */
    public String headCode = "IW";
    /**
     * 协议号
     */
    public final  String funCode = "AP49";
    /**
     * imei
     */
    private Integer heartRate;
    /**
     * 结尾封包
     */
    public String footCode = "#";


     public AP49(){}

    /**
     * IWAP49,68#
     * @param cmdStr
     */
    public AP49(String cmdStr)
    {
        String[] split = cmdStr.split(",");
        if (cmdStr.startsWith("IWAP49"))
        {
            this.heartRate = Integer.valueOf(split[1].substring(0,1));
        }
        else {
            log.error("协议格式错误:{}",cmdStr);
        }

    }



}
        



